<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="libman.css">
<TITLE>
Error Handling
</TITLE>
</HEAD>
<BODY >
<A HREF="libman060.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman052.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman062.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc135">9.9</A>&nbsp;&nbsp;Error Handling</H2>
The external solver's optimisation can abort without completely solving the
problem, because of some error, or some resource limit was reached. Eplex
classifies these into the following cases, with default ways of handling them:
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
 <B>suboptimal</B><DD CLASS="dd-description">
 	This means that a solution was found but it may be suboptimal.
	The default behaviour is to print a warning and succeed.
 <DT CLASS="dt-description"><B>unbounded</B><DD CLASS="dd-description">
	This means that the problem is unbounded. The default
	behaviour is to bind Cost to infinity (positive or negative
	depending on the optimisation direction), print a warning and
	succeed. CAUTION: No solution values are computed when the
	problem is unbounded, so unless the problem was set up with
	the solution(no) option, an error will occur when trying to
	continue as if the optimisation had succeeded.
 <DT CLASS="dt-description"><B>infeasible</B><DD CLASS="dd-description">
 This means that the problem is infeasible. Note that it is possible
 for a problem that is on the boundary between feasible and
 	infeasible to be returned as feasible or infeasible, depending on
 	the solver and solving method used. The default behaviour is to
 	fail. 
 <DT CLASS="dt-description"><B>unknown</B><DD CLASS="dd-description">
 	This means that due to the solution method chosen, it is unknown
	whether the problem is unbounded or infeasible. The default
	behaviour is to print a warning and fail (even though this
	may be logically wrong!).
 <DT CLASS="dt-description"><B>abort</B><DD CLASS="dd-description">
 	Some other error condition occurred during optimisation.
	The default behaviour is to print an error and abort.
</DL>
The default behaviours can be overridden for each problem by giving a user
defined goal to handle each case during problem setup in
eplex_solver_setup/4 (lp_setup/4, lp_demon_setup/5, or later with
eplex_set/2 or lp_set/3) as an option. If given, the user defined goal will
be executed instead. The user defined handler could for instance change
parameter settings and call lp_solve again. <BR>
<BR>
Redefining the default behaviour for infeasible problems allows the
infeasible problem state to be examined, e.g. by extracting the IIS
(Irreducible Infeasible Subsystem) from it with 
<A HREF="../bips/lib/eplex/eplex_get_iis-4.html"><B>eplex_get_iis/4</B></A><A NAME="@default341"></A>.
It is recommended that the
user-defined handler should fail after examining the state to preserve
the correct logical behaviour.<BR>
<BR>
<A NAME="lpevents"></A>
The default behaviour is implemented by raising the events <TT>eplex_suboptimal</TT>, <TT>eplex_unbounded</TT>, <TT>eplex_infeasible</TT>, <TT>eplex_unknown</TT> and <TT>eplex_abort</TT> for the different abort cases. These events can themselves be
redefined to change the default behaviours. However, as this changes the
behaviour globally, it is not recommended.<BR>
<BR>
Note that in the user defined handlers, it may be possible to extract some
useful bound information on the optimal objective value using the
best_bound and worst_bound options of lp_get/3.<BR>
<BR>
<HR>
<A HREF="libman060.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman052.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman062.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
